package com.java.datastructures;

/**
 * @author wangning
 * @create 2021-05-12 21:21
 */
public class TestMyArray {
	public static void main(String[] args) {
		//创建一个可变的数组
		MyArray myArray = new MyArray();
		//获取长度
		System.out.println("myArray.size() = " + myArray.size());
		myArray.show();
		//向可变数组中添加一个元素
		myArray.add(99);
		myArray.add(89);
		myArray.add(79);
		System.out.println("myArray.size() = " + myArray.size());
		myArray.show();
		myArray.delete(0);
		myArray.show();
		//取出指定位置的元素
		System.out.println(myArray.get(0));
		System.out.println("============");
		myArray.insert(11, 1);
		myArray.show();
		//替换指定位置的元素
		myArray.set(1, 123);
		myArray.show();
		int search = myArray.search(89);
		System.out.println("search = " + search);

	}
}
